-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning but no error if compile_standalone
but no functions found
#956
Conversation
@@ -979,6 +979,11 @@ expose_stan_functions <- function(function_env, global = FALSE, verbose = FALSE) | |||
stop("Exporting standalone functions with external C++ is not available before CmdStan 2.32", | |||
call. = FALSE) | |||
} | |||
if (!is.null(function_env$hpp_code) && | |||
!any(grepl("[[stan::function]]", function_env$hpp_code, fixed = TRUE))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrjohns Is this an ok way to check whether there are any user defined functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, looks right to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've also updated the model-expose-functions
test to be entirely skipped on WSL - so that we don't have to keep adding skips to the individual tests (which was this failed before)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #956 +/- ##
==========================================
- Coverage 88.33% 87.28% -1.05%
==========================================
Files 12 13 +1
Lines 4553 4516 -37
==========================================
- Hits 4022 3942 -80
- Misses 531 574 +43 ☔ View full report in Codecov by Sentry. |
closes #947
Submission Checklist
Summary
Continue with compilation if
compile_stanalone=TRUE
but no functions are found. Changes mysterious Rcpp error to an informative warning.Copyright and Licensing
Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Columbia University
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses: